// const presistentStorage = () => {
//   // 获取
//   const getStorage = (key: string) => {
//     return uni.getStorageSync(key);
//   };

//   // 存储
//   const setStorage = (key: string, value: any) => {
//     return uni.setStorageSync(key, value);
//   };

//   return {
//     getStorage,
//     setStorage,
//   };
// };

// export default presistentStorage;

const presistentStorage = () => {
  // 获取
  const getStorage = (key) => {
    return uni.getStorageSync(key);
  };

  // 存储
  const setStorage = (key, value) => {
    return uni.setStorageSync(key, value);
  };

  // 清空
  const clearStorage = () => {
    return uni.clearStorageSync();
  };

  //删除某个存储

  const delStorage = (key) => {
    return uni.removeStorageSync(key);
  };
  return {
    getStorage,
    setStorage,
    clearStorage,
    delStorage,
  };
};

export default presistentStorage;
